#pragma once
#include <windows.h>
#include <d3d11.h>
#include <D3DX11.h>
#include <xnamath.h>
#include <string>
#include "Param.h"

namespace mdx{

enum class ShaderPass : unsigned char{
	Vertex,
	Fragment,
};


struct Shader{

	Shader();
	~Shader();

	HRESULT Init(const Param& param);

	HRESULT Update(const Param& param);

private:

	ID3D11Device*				m_device;
	ID3D11DeviceContext*		m_imContext;
	ID3D11VertexShader*			m_pVS;
	ID3D11PixelShader*			m_pPS;
	ID3D11InputLayout*			m_pLayout;
	ID3D11Buffer*				m_pVertexCBuffer;
	ID3D11Buffer*				m_pFragmentCBuffer;
	D3D11_PRIMITIVE_TOPOLOGY	m_topology;

	static HRESULT CompileShaderFromFile(LPCWSTR szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut );
};

}